package com.android.version_prueba;

import android.app.Activity;
import android.os.Bundle;
import android.widget.*;
import android.view.*;

public class Version_pruebaActivity extends Activity 
{
	Controlador controler = new Controlador(this);
	/** Called when the activity is first created. */    
	private TextView var1;
    private TextView var2;
  
    /*private TextView var3;
    private TextView var4;
    private TextView var5;
    private TextView var6;
    private TextView var7;
    private TextView var8;
    private TextView var9;
    private TextView var10;
    private TextView var11;*/
    
	private EditText id;
	//private EditText Desc;
    private EditText Nom;
    /*private EditText F_inicio;
    private EditText F_fin;
    private EditText ide;
    private EditText v_IDE;
    private EditText sgbd;
    private EditText v_SGBD;
    private EditText cant_personal;
    private EditText cant_historias;*/
    
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    this.id=(EditText) findViewById(R.id.ID);
    this.var1=(TextView) findViewById(R.id.id);
    this.Nom=(EditText) findViewById(R.id.Nombre_Proyecto);
    this.var2=(TextView) findViewById(R.id.Nom);
    //int id = Integer.parseInt(this.id.getText().toString());
    //Proyecto p = new Proyecto();
    //controler.addProyecto(id,this.Nom.getText().toString());
    /*this.Desc=(EditText) findViewById(R.id.Descripcion);
    this.var3=(TextView) findViewById(R.id.Desc);
    this.F_inicio=(EditText) findViewById(R.id.Fecha_Inicio);
    this.var4=(TextView) findViewById(R.id.F_inicio);
    this.F_fin=(EditText) findViewById(R.id.Fecha_fin);
    this.var5=(TextView) findViewById(R.id.F_fin);
    this.ide=(EditText) findViewById(R.id.IDE);
    this.var6=(TextView) findViewById(R.id.ide);
    this.v_IDE=(EditText) findViewById(R.id.Version);
    this.var7=(TextView) findViewById(R.id.v_IDE);
    this.sgbd=(EditText) findViewById(R.id.SGBD);
    this.var8=(TextView) findViewById(R.id.sgbd);
    this.v_SGBD=(EditText) findViewById(R.id.Version);
    this.var9=(TextView) findViewById(R.id.v_SGBD);
    this.cant_personal=(EditText) findViewById(R.id.Cantidad_de_Personal);
    this.var10=(TextView) findViewById(R.id.cant_personal);
    this.cant_historias=(EditText) findViewById(R.id.Cantidad_de_Historias);
    this.var11=(TextView) findViewById(R.id.cant_historias);*/
    }
    /*public void crear(View view)
    {
    
    ProyectosSQLiteHelper prodbh = new ProyectosSQLiteHelper(this, "DBProyecto", null, 1);   	        
    SQLiteDatabase db = prodbh.getWritableDatabase();    	
    int id = Integer.parseInt(this.id.getText().toString());    
    if(db != null)
    {
       
       db.execSQL("INSERT INTO Proyecto (idproyecto, nombre) " +
                  "VALUES (" + id + ", '" + this.Nom.getText().toString() +"')");
    }
    db.close();

         
    this.var1.setText(this.id.getText().toString());
    this.var2.setText(this.Nom.getText().toString());
    controler.recibeDatos(this.Nom.getText().toString(), id);*/
     /*this.var3.setText(this.Desc.getText());
     this.var4.setText(this.F_inicio.getText());
     this.var5.setText(this.F_fin.getText());
     this.var6.setText(this.ide.getText());
     this.var7.setText(this.v_IDE.getText());
     this.var8.setText(this.sgbd.getText());
     this.var9.setText(this.v_SGBD.getText());
     this.var10.setText(this.cant_personal.getText());
     this.var11.setText(this.cant_historias.getText());
     
     
     }*/
    
    public void cancelar(View view){
     this.id.setText(null);
     this.Nom.setText(null);
    }
    
    public void refresh(View view){
     this.id.setText(null);
     this.Nom.setText(null);
     this.var1.setText(null);
     this.var2.setText(null);
    }
    public void crear(View view){
    	int id = Integer.parseInt(this.id.getText().toString());
    	controler.addProyecto(id,this.Nom.getText().toString());
    	this.id.setText(null);
        this.Nom.setText(null);
    }

    
        
}